package com.multipledatasource.util;

import java.sql.*;

public class Test {

    public static void main(String[] args) {
        try{
            Class.forName("com.mysql.jdbc.Driver");
            Connection con = DriverManager.getConnection(
                    "jdbc:mysql://118.24.151.228:3306/multiple-data-source-a",
                    "root",
                    "123456"
            );
            Statement ppst = con.createStatement();
            ResultSet rs = ppst.executeQuery("select * from user_tab");
            while (rs.next()){
                System.out.println(rs.getString("nick_name"));
            }
            con.close();
            ppst.close();
            rs.close();
        }catch (Exception e){
            e.printStackTrace();

        }
    }
}
